From: Jan Beulich Date: Fri, 26 Sep 2014 09:56:45 +0000 (+0200) Subject: VT-d: don't needlessly suppress page table sharing X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4323 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=691cb082a2ca0b6d2b7b8f246fab20e227a412a3;p=xen.git VT-d: don't needlessly suppress page table sharing Despite the mid term goal being to do away with the sharing there's no point in suppressing it in cases where it can be used now. Signed-off-by: Jan Beulich Acked-by: Kevin Tian --- diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 042b882a71..63038d9394 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1805,7 +1805,7 @@ void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, } } -static int vtd_ept_page_compatible(struct iommu *iommu) +static int __init vtd_ept_page_compatible(struct iommu *iommu) { u64 ept_cap, vtd_cap = iommu->cap; @@ -1814,8 +1814,8 @@ static int vtd_ept_page_compatible(struct iommu *iommu) if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) return 0; - return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap) - && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) ); + return (ept_has_2mb(ept_cap) && opt_hap_2mb) == cap_sps_2mb(vtd_cap) && + (ept_has_1gb(ept_cap) && opt_hap_1gb) == cap_sps_1gb(vtd_cap); } /*